import { ActionDesc, PagesKey } from '@/global/constant'
import { IContentConfig, TableItemType } from '@/components/page-content/type'

const questionListContent: IContentConfig = {
  pageKey: PagesKey.QuestionList,
  tableConfig: {
    // bordered: true,
    size: 'small',
    scroll: {
      x: 1280
    },
    rowKey: 'questionId'
  },
  isShowPagination: true,
  isShowRowSelection: true,
  isShowMoreAction: true,
  moreActions: [
    { key: ActionDesc.QuestionDetail, label: '查看详情' },
    { key: ActionDesc.Edit, label: '修改' },
    { key: ActionDesc.Delete, label: '删除' }
  ],
  isShowAddBtn: false,
  isShowBatchBtn: true,
  batchActions: [{ key: ActionDesc.BatchDelete, label: '批量删除' }],
  tableItems: [
    {
      type: TableItemType.Column,
      title: '题目类型',
      dataIndex: 'questionType',
      customkey: 'questionType'
    },
    {
      type: TableItemType.Column,
      title: '题目标题',
      dataIndex: 'questionTitle',
      width: 300
    },
    {
      type: TableItemType.Column,
      title: '所属分类',
      customkey: 'cateType',
      dataIndex: 'classifyFirstName',
      width: 170
    },
    {
      type: TableItemType.Column,
      title: '是否包含代码',
      dataIndex: 'codeFlag',
      customkey: 'codeFlag'
    },
    {
      type: TableItemType.Column,
      title: '代码块内容',
      dataIndex: 'questionCode',
      customkey: 'questionCode',
      width: 250
    },
    {
      type: TableItemType.Column,
      title: '选项',
      dataIndex: 'questionOptions',
      customkey: 'questionOptions'
    },
    {
      type: TableItemType.Column,
      title: '答案',
      dataIndex: 'questionAnswer',
      customkey: 'questionAnswer'
      // width: 140
    }
  ]
}

export default questionListContent
